

$baseFontSize: 75;

// @function px2rem($px){
//   @return $px / $baseFontSize  * 1rem;
// }

// @mixin px2rem($name,$px){
//     #{$name}: $px / $baseFontSize * 1rem;
// }

@mixin bg-image($url){
  background-image: url($url + "@2x.png");
  @media (-webkit-min-device-pixel-ratio: 3),(min-device-pixel-ratio: 3){
    background-image: url($url + "@3x.png")
  }
}

@mixin ellipsis($line){
  @if $line==1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 1;
  }
  @else {
    word-break: break-all;
    overflow: hidden;
    white-space:normal;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp:$line;
    /* autoprefixer: off */
    -webkit-box-orient: vertical
    /* autoprefixer: on */
  }
}

@mixin triangleDown($direction: 'top', $size: 10, $color: #999,) {
  @if $direction=='top' {
    width: 0;
    height: 0;
    border-style:solid;
    border-width:0 #{$size - 2}+px $size+px;
    border-color:transparent transparent $color;/*灰 透明 透明 */
  } @else if ($direction=='down'){
    width: 0;
    height: 0;
    border-style:solid;
    border-width:$size+px #{$size - 2}+px 0;
    border-color:$color transparent transparent;/*灰 透明 透明 */
  }
}
